<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>这是div</div>
<script>
  /*创建h1标签*/
  let h1 = document.createElement("h1");
  h1.innerText = "这是h1";
  /*天添加到body里面 document。body获取body元素对象*/
  document.body.append(h1);
  let img = document.createElement("img");
  /*图片路径*/
  img.src = "../2.png";
  /*“append添加元素”*/
  document.body.append(img);
</script>
</body>
</html>